package Messages;

import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

import Server.SQLConnection;
import ocsf.server.ConnectionToClient;

public class MessageBank {
	
	private ConnectionToClient client ;
	private ArrayList<Object> str ; 

	public MessageBank(ArrayList<Object> msg, ConnectionToClient client) {
		
		this.client= client ;
		this.str= msg; 		
		
	}
	
	
	
	public void Bank() throws SQLException, IOException{
		
		SQLConnection sc = new SQLConnection();
		
		java.sql.PreparedStatement ps = sc.getConnection().prepareStatement("SELECT * FROM hts.SBank;");
		ResultSet SuppRes= ps.executeQuery();
		ArrayList<Object> Bank =new ArrayList<Object>();
		Bank.add("Bank");
		while (SuppRes.next())
		{
			Bank.add(SuppRes.getInt(1));
			Bank.add(SuppRes.getString(2));
			Bank.add(SuppRes.getString(3));
			Bank.add(SuppRes.getString(4));
	
		}
		client.sendToClient(Bank);
	}

}
